import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Home from "../views/Home.vue"
const routes: Array<RouteRecordRaw> = [
  {
    path:'/',
    component:Home,
    redirect:'/homePage',
    children:[
      {
        path:'homePage',
        component:()=>import('../views/layout/HomePage.vue'),
        children:[
            // 主页热租爆品相关路由跳转
          {
          path:'',
          component:()=>import('../views/hotpages/Qijian.vue')
          },
          {
            path:'yanxuan',
            component:()=>import('../views/hotpages/YX.vue')
          },
          {
            path:'qingcang',
            component:()=>import('../views/hotpages/QD.vue')
          },
          {
          path:'chaowan',
          component:()=>import('../views/hotpages/CT.vue')
          },
          {
            path:'jujia',
            component:()=>import('../views/hotpages/JS.vue')
          },
          {
            path:'bangong',
            component:()=>import('../views/hotpages/BS.vue')
          },
          {
            path:'gehu',
            component:()=>import('../views/hotpages/GM.vue')
          },
          {
            path:'shepin',
            component:()=>import('../views/hotpages/SX.vue')
          },
          {
            path:'yanchu',
            component:()=>import('../views/hotpages/YQ.vue')
          },
        ]
      },
      {
        path:'sort',
        component:()=>import('../views/layout/Sort.vue')
      },
      {
        path:'strictSelect',
        component:()=>import('../views/layout/StrictSelect.vue')
      },
      {
        path:'expore',
        component:()=>import('../views/layout/Expore.vue')
      },
      {
        path:'mine',
        component:()=>import('../views/layout/Mine.vue')
      }
    ]
  },
  {
    path:'/confirm',
    component:()=>import('../views/Confirm.vue')
  },
  {
    path:'/login',
    component:()=>import('../views/Login.vue')
  },
  {
    path:'/reg',
    component:()=>import('../views/Reg.vue')
  },
  {
    path:'/index',
    component:()=>import('../views/admin/Index.vue'),
    children:[
      {
        path:'userManage',
        component:()=>import('../views/admin/UserManage.vue')
      },
      {
        path:'order',
        component:()=>import('../views/admin/Order.vue')
      }
    ]
  },
  {
    path:'/footmark',
    component:()=>import('../views/layout/Mine/FootMark.vue')
  },
  {
    path:'/citylist',
    component:()=>import('../views/layout/HomePage/CityList.vue')
  },
  {
    path:'/productDetailsPage',
    component:()=>import("../views/layout/ProductDetailsPage.vue")
  },
  {
    path:'/favorives',
    component:()=>import("../views/layout/Favorives.vue")
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
